// hdoj 1002
# include<bits/stdc++.h>
using namespace std;
int main()
{
   int T;
   vector<char> res(1001, '0'); //!!!!
   cin >> T;
   for (int i = 1; i <= T; ++i)
   {
       string _a;
       string _b;
       vector<char> res(1001, '0');
       cin >> _a >> _b;
//        string _a = to_string(a);
//        string _b = to_string(b);
       int len = min(_a.length(), _b.length());
       int add = 0;
       int j = 0;
       for (; j < len; ++j)
       {
           int tmp = (_a[_a.length() - 1 - j] - '0') + (_b[_b.length() - 1 - j] - '0') + add;
           res[1000 - j] = '0' + tmp % 10;
           add = tmp / 10;
       }
       while (j < _a.length())
       {
           int tmp = _a[_a.length() - 1 - j] - '0' + add;
           res[1000 - j] = '0' + tmp % 10;
           add = tmp / 10;
           j++;
       }
       while (j < _b.length())
       {
           int tmp = _b[_b.length() - 1 - j] - '0' + add;
           res[1000 - j] = '0' + tmp % 10;
           add = tmp / 10;
           j++;
       }
       if (add) //注意！
       {
           res[1000 - j] = add + '0';
       }
       cout << "Case " << i << ":" << endl;
       cout << _a << " + " << _b << " = ";
       int start = 0;
       while (res[start] == '0')
       {
           start++;
       }
       for (int k = start; k < 1001; ++k)
       {
           cout << res[k];
       }
       cout << endl;
       if (i != T)
           cout << endl;
   }
   return 0;
}
